﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NCRGEA.Reports
{
    public partial class frmGroupReport : Form
    {
        private short GroupCode = 1;

        public frmGroupReport()
        {
            InitializeComponent();
        }

        public frmGroupReport(short GroupCode) : this()
        {
            this.GroupCode = GroupCode;
            DataTable dt = AAL.DAL.ExecuteQuery("SELECT GroupName FROM memGroup WHERE GroupID=" + GroupCode);
            if (dt != null || dt.Rows.Count == 1)
                this.Text = dt.Rows[0][0].ToString() + " Group Report";
        }

        private void frmGroupReport_Load(object sender, EventArgs e)
        {
            this.standardMembersTableAdapter.FillByGroup(this.nCRGEADataSet.StandardMembers, GroupCode);
            this.reportViewer1.RefreshReport();
        }
    }
}
